<?php
include_once('./config/init.php');

//判断是否有登录
$LoginUser = AuthLogin();

?>
<div class="navbar">
    <div class="navbar-inner">
        <ul class="nav pull-right">
            <li>
                <a href="javascript:void(0)" role="button">
                    <i class="icon-user"></i>
                    <?php echo $LoginUser['nickname'];?>
                </a>
            </li>
            <li>
                <a href="javascript:void(0)" id="logout" class="hidden-phone visible-tablet visible-desktop" role="button">退出登录</a>
            </li>
        </ul>
        <a class="brand" href="index.php"><span class="second">Admin</span></a>
    </div>
</div>
<script>
    $("#logout").click(function(){
        //确认对话框
        if(confirm("是否确认退出")){
            //跳转界面
            location.href = `login.php?action=logout`
            return false
        }
    })
</script>